package com.casic.modules.activiti.service.factory;

import com.casic.modules.activiti.service.ActGroupEntityService;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
import org.activiti.engine.impl.persistence.entity.GroupIdentityManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Activiti Group Entity Factory
 * @author ThinkGem
 * @version 2013-11-03
 */
@Service
public class ActGroupEntityServiceFactory implements SessionFactory {
	
	@Resource
	private ActGroupEntityService actGroupEntityService;
	
	public Class<?> getSessionType() {
		// 返回原始的GroupIdentityManager类型
		return GroupIdentityManager.class;
	}

	public Session openSession() {
		// 返回自定义的GroupEntityManager实例
		return actGroupEntityService;
	}

}
